package com.xhd.server;

public class CPCServerId
{
  private String jm111 = null;
  private String jm392 = null;
  private String jm84 = null;
  private int jm531 = 0;
  private static CPCServerId jm639 = null;

  private CPCServerId()
  {
  }

  public CPCServerId(String paramString)
  {
    if ((paramString == null) || (paramString.length() <= 0))
      return;
    this.jm111 = paramString;
    int i = 0;
    int j = 0;
    for (int k = 0; (j == 0) && (k < 3); ++k)
    {
      int l = this.jm111.indexOf(46, i);
      String str = null;
      if (l > 0)
      {
        str = this.jm111.substring(i, l);
        i = l + 1;
      }
      else
      {
        str = this.jm111.substring(i);
        j = 1;
      }
      if (k == 0)
      {
        this.jm392 = str;
      }
      else if (k == 1)
      {
        if ((str == null) || (str.length() <= 0))
          continue;
        this.jm531 = Integer.parseInt(str);
      }
      else
      {
        this.jm84 = str;
      }
    }
  }

  public CPCServerId(String paramString, int paramInt)
  {
    jm638(paramString, paramInt, null);
  }

  public CPCServerId(String paramString1, int paramInt, String paramString2)
  {
    jm638(paramString1, paramInt, paramString2);
  }

  public static CPCServerId getAllLocal()
  {
    CPCServerId localCPCServerId = new CPCServerId();
    localCPCServerId.jm638(ServerConfig.CompanyId, 0, null);
    return localCPCServerId;
  }

  public static CPCServerId getLocal()
  {
    if (jm639 != null)
      return jm639;
    CPCServerId localCPCServerId = new CPCServerId();
    localCPCServerId.jm638(ServerConfig.CompanyId, ServerConfig.ServerType, ServerConfig.ServerId);
    jm639 = localCPCServerId;
    return localCPCServerId;
  }

  public static CPCServerId getLocal(int paramInt, String paramString)
  {
    CPCServerId localCPCServerId = new CPCServerId();
    localCPCServerId.jm638(ServerConfig.CompanyId, paramInt, paramString);
    return localCPCServerId;
  }

  public static CPCServerId getLocal(int paramInt)
  {
    CPCServerId localCPCServerId = new CPCServerId();
    localCPCServerId.jm638(ServerConfig.CompanyId, paramInt, null);
    return localCPCServerId;
  }

  public String getCompId()
  {
    return this.jm392;
  }

  public int getServerType()
  {
    return this.jm531;
  }

  public String getServerId()
  {
    return this.jm84;
  }

  public String getId()
  {
    return this.jm111;
  }

  private String jm638(String paramString1, int paramInt, String paramString2)
  {
    this.jm531 = paramInt;
    this.jm84 = paramString2;
    this.jm392 = paramString1;
    if (this.jm531 < 1)
    {
      this.jm111 = this.jm392;
      return this.jm111;
    }
    if ((this.jm84 == null) || (this.jm84.length() < 1))
      this.jm111 = this.jm392 + "." + this.jm531;
    else
      this.jm111 = this.jm392 + "." + this.jm531 + "." + this.jm84;
    return this.jm111;
  }
}
